package com;

import com.service.UserService;
import com.service.UserServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Mytest {
    @Test
    public void test(){
        ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        //动态代理需要代理接口
        UserService userService =  context.getBean("userService",UserService.class);
        userService.add();
    }
}
